import axiosInstance from "../axios";
/**
 * @descriptions 创建分类
 * @data {title,pid}
 * @returns <AxiosPromise>
 */
export function addCategory(data) {
    return axiosInstance({
        method: 'post',
        url: '/Category/Category.php?s=addCategory',
        data
    })
}
/**
 * @descriptions 修改分类
 * @data {classId,title,pid}
 * @returns <AxiosPromise>
 */
export function amendCategory(data) {
    return axiosInstance({
        method: 'post',
        url: '/Category/Category.php?s=amendCategory',
        data
    })
}
/**
 * @descriptions 分类列表
 * @data {[keyword:搜索关键字,classId]} 
 * @returns <AxiosPromise>
 */
export function getAll(data = {}) {
    return axiosInstance({
        method: 'post',
        url: '/Category/Category.php?s=getAll',
        data
    })
}
/**
 * @descriptions 删除分类
 * @data {classId}
 * @returns <AxiosPromise>
 */
export function deleteCategory(data) {
    return axiosInstance({
        method: 'post',
        url: '/Category/Category.php?s=deleteCategory',
        data
    })
}

/**
 * @descriptions 获取所有书签
 * @data {id,classId,keyword}
 * @returns <AxiosPromise>
 */
export function allBook(data) {
    return axiosInstance({
        method: 'post',
        url: '/Book/Book.php?s=allBook',
        data
    })
}